using System;
using System.Collections.Generic;
using System.Linq;
using Toast.ContentTypes;
using Toast.Core;
using Toast.Core.Interfaces;
using Toast.Filters;
using Toast.Utils;

namespace Toast.Extensions
{
    public static class ContentExtensions
    {
        public static void Add(this ContentCollection collection, IContent javaScriptContent)
        {
            collection.Add(javaScriptContent);
        }

        public static void Add(this ContentCollection collection, ContentCollection references)
        {
            foreach (var scriptReference in references)
                Add(collection, scriptReference);
        }

        public static ContentCollection ToScriptCollection(this IEnumerable<IContent> scripts)
        {
            var sc = new ContentCollection();

            foreach (var script in scripts)
                sc.Add(script);

            return sc;
        }


    }
}